﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Frame.Lib.Data;


namespace Forum.Entity.Group
{
    public partial class GroupInfo : EntityBase
    {
        public override string GetTableName()
        {
            return "f_group";
        }
        public override string GetInsertSql()
        {
            return "insert into f_group ( [ID], [Name], [TypeID], [CreditMin], [CreditMax], [StarCount], [MaxAttachSize]) values ( @ID, @Name, @TypeID, @CreditMin, @CreditMax, @StarCount, @MaxAttachSize)";
        }
        public override string GetUpdateSql()
        {
            return "update f_group set  [Name] = @Name, [TypeID] = @TypeID, [CreditMin] = @CreditMin, [CreditMax] = @CreditMax, [StarCount] = @StarCount, [MaxAttachSize] = @MaxAttachSize where ID = @ID";
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 ID
        {
            get;
            set;
        }
        /// <summary>
        /// 组名
        /// </summary>
        public String Name
        {
            get;
            set;
        }
        /// <summary>
        /// 组类型（枚举）
        /// </summary>
        public Int32 TypeID
        {
            get;
            set;
        }
        /// <summary>
        /// 积分下限
        /// </summary>
        public Int32 CreditMin
        {
            get;
            set;
        }
        /// <summary>
        /// 积分上限
        /// </summary>
        public Int32 CreditMax
        {
            get;
            set;
        }
        /// <summary>
        /// 星星个数
        /// </summary>
        public Int32 StarCount
        {
            get;
            set;
        }
        /// <summary>
        /// 允许上传附件的最大心寸
        /// </summary>
        public Int32 MaxAttachSize
        {
            get;
            set;
        }
        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    this.ID = (Int32)value;
                    break;
                case "name":
                    this.Name = (String)value;
                    break;
                case "typeid":
                    this.TypeID = (Int32)value;
                    break;
                case "creditmin":
                    this.CreditMin = (Int32)value;
                    break;
                case "creditmax":
                    this.CreditMax = (Int32)value;
                    break;
                case "starcount":
                    this.StarCount = (Int32)value;
                    break;
                case "maxattachsize":
                    this.MaxAttachSize = (Int32)value;
                    break;
            }
        }
        public override object GetValue(string key)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    return this.ID;
                case "name":
                    return this.Name;
                case "typeid":
                    return this.TypeID;
                case "creditmin":
                    return this.CreditMin;
                case "creditmax":
                    return this.CreditMax;
                case "starcount":
                    return this.StarCount;
                case "maxattachsize":
                    return this.MaxAttachSize;
                default:
                    return null;
            }
        }
    }


}
